package com.thread.callback;

import java.util.Random;

/**
 * 线程执行完 返回结果--使用回调
 * @author zhangshuqing
 *
 */
public class MyThread  implements Runnable{

	private CallBack callback;
	public MyThread(CallBack callback) {
		this.callback=callback;
	}
	
	
	@Override
	public void run() {
		Random random=new Random();
		for (int i = 0; i < 10; i++) {
			System.out.println("print:"+i);
		}
		int seq=random.nextInt();
		System.out.println(seq);
		callback.sayEnd(seq);
	}

}
